/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.supinfo.youfood.service;

import com.supinfo.youfood.dao.CommandeDao;
import com.supinfo.youfood.entity.Commande;
import com.supinfo.youfood.entity.Restaurant;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Michael
 */
@Stateless
public class CommandeService {
    
    @EJB
    private CommandeDao commande;
    
    public void addCommand(Commande c) {
        commande.creerCommande(c);
    }
    
    public List<Commande> getAllCommandes()
    {
        return commande.getAllCommandes();
    }
    
    public Commande findCommandeById(Long id) {
        return commande.findCommandeById(id);
    }
    
    public List<Commande> getAllCommandesByRestaurant(Restaurant res) {
        return commande.getAllCommandesByResto(res);
    }
    
    public void updateCommande(Commande c) {
        commande.updateCommande(c);
    }
}
